﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using wfDesigner.ViewModel;

namespace wfDesigner
{
    /// <summary>
    /// FlowTypeControl.xaml 的交互逻辑
    /// </summary>
    public partial class FlowChartControl : UserControl
    {
        public FlowChartViewModel vm = null;
        public FlowChartControl()
        {  
           
            InitializeComponent();
            vm = new FlowChartViewModel();
            this.DataContext = vm;

        }

       
        private void Addbtn_Click(object sender, RoutedEventArgs e)
        {
            AddFlowChartWindow addFT = new AddFlowChartWindow();          
            addFT.ShowDialog();
            vm.Query(1);
            vm.PageIndex = 1;
        }

        private void dataPager_PageChanged(object sender, CustomControlLibrary.PageChangedEventArgs args)
        {
                    vm.Query(args.PageIndex);           
        }

        private void Editbtn_Click(object sender, RoutedEventArgs e)
        {
            UpdateFlowChartWindow upFC = new UpdateFlowChartWindow();
            upFC.DataContext = vm;
            upFC.ShowDialog();
            vm.Query(1);
            vm.PageIndex = 1;
        }

    
        }

      
    
}
